using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Bulb.Test.RepositoryTests
{
    [TestClass]
    public class UpdateTests
        : RepositoryTests
    {
        [TestMethod]
        public void TestThatAddAddsBulbToRepository()
        {
            Assert.AreEqual(3, MockBulbItemRepository.All().Count);

            var updateBulbItem = MockBulbItemRepository.Get(1);
            updateBulbItem.Name = "Changed";

            MockBulbItemRepository.Update(updateBulbItem);

            Assert.AreEqual(3, MockBulbItemRepository.All().Count);

            var updatedBulbItem = MockBulbItemRepository.Get(1);
            Assert.IsNotNull(updatedBulbItem);
            Assert.AreEqual(1, updatedBulbItem.Id);
            Assert.AreEqual("Changed", updatedBulbItem.Name);
        }
    }
}